package com.yeren.thread.changeState.sleep;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * sleep阻塞
 */
public class TestSleep3 {
	public static void main(String[] args) {
		//电子表
		SimpleDateFormat sdf= new SimpleDateFormat("HH:mm:ss");
		while(true){
			Date now=new Date();
			System.out.println(sdf.format(now));
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
